<include file="Common:layout" />
<style>
    .ncm-goods-gift {
        text-align: left;
    }
    .ncm-goods-gift ul {
        display: inline-block;
        font-size: 0;
        vertical-align: middle;
    }
    .ncm-goods-gift li {
        display: inline-block;
        letter-spacing: normal;
        margin-right: 4px;
        vertical-align: top;
        word-spacing: normal;
    }
    .ncm-goods-gift li a {
        background-color: #fff;
        display: table-cell;
        height: 30px;
        line-height: 0;
        overflow: hidden;
        text-align: center;
        vertical-align: middle;
        width: 30px;
    }
    .ncm-goods-gift li a img {
        max-height: 30px;
        max-width: 30px;
    }

    a.green{

        background: #fff none repeat scroll 0 0;
        border: 1px solid #f5f5f5;
        border-radius: 4px;
        color: #999;
        cursor: pointer !important;
        display: inline-block;
        font-size: 12px;
        font-weight: normal;
        height: 20px;
        letter-spacing: normal;
        line-height: 20px;
        margin: 0 5px 0 0;
        padding: 1px 6px;
        vertical-align: top;
    }

    a.green:hover { color: #FFF; background-color: #1BBC9D; border-color: #16A086; }

    .ncap-order-style .ncap-order-details{
        margin:20px auto;
    }
    .contact-info h3,.contact-info .form_class{
        display: inline-block;
        vertical-align: middle;
    }
    .form_class i.fa{
        vertical-align: text-bottom;
    }
</style>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.go(-1)" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>商品订单</h3>
                <h5>商城实物商品交易订单查询及管理</h5>
            </div>
        </div>
    </div>
    <div class="ncap-order-style">
        <div class="titile">
            <h3></h3>
        </div>

        <div class="ncap-order-details">
            <form id="order-action">
                <input type="hidden" value="{$order['id']}" id="order_id">
                <div class="tabs-panels">
                    <div class="misc-info">
                        <h3>基本信息</h3>
                        <dl>
                            <dt>订单 ID：</dt>
                            <dd>{$order['id']}</dd>
                            <dt>订单号：</dt>
                            <dd>{$order['order_id']}</dd>
                            <dt>会员：</dt>
                            <dd>{$order['agent_name']}</dd>
                        </dl>
                        <dl>
                            <dt>下单人手机：</dt>
                            <dd>{$order['user_phone']}</dd>
                            <dt>订单金额：</dt>
                            <dd>{$order['price']}（含运费）
                                <if condition="$order['is_pay'] eq -1 AND $order['status'] neq -1">
                                    <a class="btn green modify_price" href="{:U('Order/modify_price', array('id'=>$order['id']))}">
                                        <i class="fa fa-edit"></i>修改
                                    </a>
                                </if>
                            </dd>
                            <dt>折扣：</dt>
                            <dd>{$order['discount']}</dd>
                        </dl>
                        <dl>
                            <dt>订单状态：</dt>
                            <dd>
                                <if condition="$order['is_pay'] eq -1">
                                    <span class="label label-active radius">未付款</span>
                                    <else />
                                    <span class="label label-success radius">已付款</span>
                                </if>

                                <switch name="order['status']">
                                    <case value="-1">
                                        <span class="label label-danger radius">已取消</span>
                                    </case>
                                    <case value="1">
                                        <span class="label label-warning radius">待确认</span>
                                    </case>
                                    <case value="2">
                                        <span class="label label-secondary radius">已确认</span>
                                    </case>
                                    <case value="3">
                                        <span class="label label-success radius">已完成</span>
                                    </case>
                                </switch>

                                <if condition="$order['is_deliver'] eq -1 AND $order['is_agree'] neq -1">
                                    <span class="label label-active radius">未发货</span>
                                    <elseif condition="$order['is_deliver'] eq -1 AND $order['is_agree'] eq -1"/>
                                    <span class="label label-active radius">董事审核不通过</span>
                                    <else />
                                    <span class="label label-success radius">已发货</span>
                                </if>
                            </dd>
                            <dt>下单时间：</dt>
                            <dd>{$order['time']|date="Y-m-d H:i:s",###}</dd>
                            <dt>支付方式：</dt>
                            <dd>{$pay_type}</dd>
                        </dl>
                    </div>
                    <div class="addr-note">
                        <h4>收货信息</h4>
                        <dl>
                            <dt>收货人：</dt>
                            <dd>{$order['consignee']}</dd>
                            <dt>联系方式：</dt>
                            <dd>{$order['phone']}</dd>
                        </dl>
                        <notempty name="order['code_num']">
                            <dl>
                                <dt>发货单：</dt>
                                <dd>{$order['code_num']}</dd>
                                <dt>发货时间：</dt>
                                <dd>{$order['deliver_time']|date='Y-m-d H:i:s',###}</dd>
                            </dl>
                        </notempty>
                        <dl>
                            <dt>收货地址：</dt>
                            <dd>{$order['detail_area']}</dd>
                        </dl>
                        <dl>
                            <dt>留言：</dt>
                            <dd>{$order['message']}</dd>
                        </dl>
                    </div>

                    <div class="misc-info">
                        <h4>订单流向</h4>
                        <volist name="orderThrough" id="through" key="k" empty="最顶级代理到平台的订单">
                            {$through['agent_name']}
                            <if condition="$through['state'] eq 1">
                                <span style="color: green">(已通过)</span>、
                                <elseif condition="$through['state'] eq 0"/>
                                <span><!--未审核--></span>
                                <else />
                                <span style="color: red;">(不通过)</span>
                            </if>
                        </volist>
                    </div>

                    <div class="goods-info">
                        <h4>商品信息</h4>
                        <table>
                            <thead>
                            <tr>
                                <th >商品编号</th>
                                <th>商品图片</th>
                                <th>商品</th>
                                <th>数量</th>
                                <th>规格</th>
                                <th>拿货类型</th>
                                <th>小计(元)</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="orderGoods" id="good">
                                <tr>
                                    <td>{$good['id']}</td>
                                    <td>
                                        <a href="{$good['img']}" target="_blank"><img src="{$good['img']}" style="height: 20px;"/></a>
                                    </td>
                                    <td>{$good['g_name']|cut_str='15',###}</td>
                                    <td>{$good['num']}</td>
                                    <td>
                                        <php>
                                            if(!empty($good['spec_str'])) {
                                                echo unserialize($good['spec_str']);
                                            } else {
                                                echo '无';
                                            }
                                        </php>
                                    </td>
                                    <td>
										<if condition="$good['good_type'] eq 1">
											件
											<elseif condition="$good['good_type'] eq 2"/>
											箱
											<else/>
											件
										</if>

                                    </td>
                                    <td>{$good['goods_price']}</td>
                                </tr>
                            </volist>
                        </table>
                    </div>
                    <p style="margin-top: 10px;">
                        <if condition="$order['is_deliver'] eq 1 AND $order['is_platform'] eq 1">
                            <a class="ncap-btn-big ncap-btn-green" href="{:U('Admin/Order/invoice',array('id'=>$order['id']))}">查看发货单</a>
                        </if>
                    </p>
                </div>
            </form>
        </div>
    </div>
</div>

</body>
</html>